<?php
include 'Controller.php'; 

class MainController extends Controller {

            //Ustawianie szabloonu html
            public function getTemplate(){
                  return $this->template; 
            }             
            
            public function setTemplate($tpl){
                  $this->template=$tpl; 
            }
            
            
            
            
            public  function show(){    
                $smarty=new Smarty();
                $smarty->compile_dir=TEMPLATES_C;              
                $tmp=$this->getView() ;
                        $smarty->assign($this->getName(),$tmp[$this->getName()]);
                        $smarty->display($this->template);
            
            }
                                       
            public function createView(){
                  return array("komp"=>array("name"=>"jakisTPL.tpl"));
           
            }
            
            public   function getView(){                
            foreach($this->controller as $controller ){
            $this->view[$this->getName()][$controller->getName()]=$controller->getView();
            } 
            if(sizeof($this->controller)!=0)$this->view[$this->getName()][$this->getName()]=$this->createView();  
            else     $this->view=$this->createView();
            return $this->view;
            
             }
            
            
            
}

?>
